<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <base href="<%=basePath%>">
  
  <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
  <title>牌YOU圈新昌游戏下载</title>
  <style type="text/css">
    html{
      height: 100%;
    }
   	.download{
      position:absolute;
   	  padding-top:20px;
      bottom:20%;
   	}
    .download>.download-btn{
      padding: 10px;
    }

    .android-btn>img,.ios-btn>img,#weixin-tip img{
      max-width:100%;
    }

    #weixin-tip {
      display: none;
      position: fixed;
      left: 0;
      top: 0;
      background: rgba(0,0,0,0.8);
      filter: alpha(opacity=80);
      width: 100%;
      height: 100%;
      z-index: 100;
    }
    #weixin-tip p{
      text-align: center;
      margin-top: 10%;
      padding: 0 5%;
      position: relative;
    }

    #weixin-tip .close {
      color: #fff;
      padding: 5px;
      font: bold 20px/20px simsun;
      text-shadow: 0 1px 0 #ddd;
      position: absolute;
      top: 0;
      left: 5%;
      opacity: 0.9;
    }

    #welcome-body {
  
      background: url(images/download1.jpg);
      background-size: cover;
      /* background-color: #cadae9; */
    }
</style>
</head>
<body id="welcome-body">
<!--   <div class="bg">
    <img src="image/download1.jpg">
  </div> -->
  <!-- <div class="download clearfix">
    <div class="download-btn">
    <a href="http://120.77.155.225:8080/mina/download/apk/pyq.apk" class="android-btn col-xs-6" id="android-apk">
      <img src="image/android-btn.png" alt="安卓版下载">
    </a>
    </div>
  </div> -->
  <div id="weixin-tip">
    <p>
      <img src="images/live_weixin.png" alt="微信打开"/>
      <span id="close" title="关闭" class="close">×</span>
    </p>
  </div>
  <script type="text/javascript">
    var is_weixin = (function() {
      var ua = navigator.userAgent.toLowerCase();//获取浏览器的相关信息
      if (ua.match(/MicroMessenger/i) == "micromessenger") {
          return true;//是微信内置浏览器
      } else {
          return false;
      }
    })();
    console.log(is_weixin);
    window.onload = function(){
      var winHeight = typeof window.innerHeight != 'undefined' ? window.innerHeight : document.documentElement.clientHeight; //兼容IOS
      //var btn-android = document.getElementById('android-apk');
      //var btn_ios = document.getElementById('ios-apk');
      var tip = document.getElementById('weixin-tip');
      var close = document.getElementById('close');
      if(is_weixin){
        tip.style.height = winHeight + 'px';
        tip.style.display = 'block';
        
        close.onclick = function(){
          tip.style.display = 'none';
        };
      }else{
        window.location.href='http://120.77.155.225:8080/mina/download/apk/pyq.apk';
      }
      
    };
  </script>
</body>
</html>